package com.cwvs.cat.bean;

import org.json.JSONException;
import org.json.JSONObject;


public class News {
	
	 public String id;
	 public String org_id;
	 public String act_id;
	 public String sender;
	 public String created;
	 public String orderby;
	 public String pic;
	 public String content;
	 public String share_news_id;
	 public String status;

	public void fromJson(JSONObject json){
		id = json.optString("id");
		org_id = json.optString("org_id");
		act_id = json.optString("act_id");
		sender = json.optString("sender");
		created = json.optString("created");
		orderby = json.optString("orderby");
		pic = json.optString("pic");
		content = json.optString("content");
		share_news_id = json.optString("share_news_id");
		status = json.optString("status");
	}
	public JSONObject toJson(){
		JSONObject json = new JSONObject();
		try {
			json.put("id", id);
			json.put("org_id", org_id);
			json.put("act_id", act_id);
			json.put("sender", sender);
			json.put("created", created);
			json.put("orderby", orderby);
			json.put("pic", pic);
			json.put("content", content);
			json.put("share_news_id", share_news_id);
			json.put("status", status);
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return json;
	}
	public static News createFromJson(JSONObject json) {
		News user = new News();
		user.fromJson(json);
		return user;
	}
}
